package com.jyu.hakkatranslation.commons.model;

import lombok.Data;

/**
 * @author Akihi
 * @create 2023/01/07 19:23
 */
@Data
public class ReturnObject {
    private String code;  //处理成功或失败的标记  1-- 成功   0--失败
    private String message; // 提示信息
    private Object returnData; //返回的其他数据

    public ReturnObject(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public ReturnObject(String code, String message, Object returnData) {
        this.code = code;
        this.message = message;
        this.returnData = returnData;
    }

    public static ReturnObject success(){
        return new ReturnObject("1", null, null);
    }
    public static ReturnObject success(Object returnData){
        return new ReturnObject("1", null, returnData);
    }
}
